package com.youxin.busfoundation.enums;

import java.util.ArrayList;
import java.util.List;

import com.youxin.busfoundation.common.KeyValue;

/**
 * 注册资本 100万以下
100-200万
200-500万
500-1000万
1000万以上
 * @author yingde.cao
 *
 */
public enum EnterpriseRegisteredCapitalType {
	All(0,"所有",0,0),
	Less1Billion(1,"100万以下",0,100),
	Less2Billion(2,"100-200万",100,200),
	Less5Billion(3,"200-500万",200,500),
	Less10Billion(4,"500-1000万",500,1000),
	Greater10Billion(5,"1000万以上",1000,Integer.MAX_VALUE),
	;
	
	private int min,max;
	
	
	public int getMin() {
		return min;
	}

	public void setMin(int min) {
		this.min = min;
	}

	public int getMax() {
		return max;
	}

	public void setMax(int max) {
		this.max = max;
	}

	public int getValue() {
		return value;
	}
	
	private int value;
	private String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValue(int value) {
		this.value = value;
	}

	private EnterpriseRegisteredCapitalType(int value,String name,int min,int max) {
		this.value = value;
		this.name=name;
		this.min=min;
		this.max=max;
	}
	
	public static EnterpriseRegisteredCapitalType valueOf(int val)
	{			
		for(EnterpriseRegisteredCapitalType m : EnterpriseRegisteredCapitalType.values()) 
		{
			if(val==m.getValue())
				return m;
	    }
		return null;
	}
	
	public static List<KeyValue<Integer, String>> keyValues(){
		List<KeyValue<Integer, String>>  list=new ArrayList<>(6);
		for(EnterpriseRegisteredCapitalType m : EnterpriseRegisteredCapitalType.values()) 
		{
			KeyValue<Integer, String> keyValueItem=new KeyValue<>(m.getValue(),m.getName());
			list.add(keyValueItem);
	    }
		return list;
	}
	
}
